@model Netnr.Domain.Run
@{
    var mo = Model ?? new Netnr.Domain.Run();
    mo.RunTheme = string.IsNullOrWhiteSpace(mo.RunTheme) ? "vs" : mo.RunTheme;
}

@if (Model != null)
{
    ViewData["Title"] = "Editing " + mo.RunRemark;
}
else
{
    ViewData["Title"] = "NetnrRun";
    mo.RunContent1 = @"<!DOCTYPE html>
<html>

<head>
    <meta name=""viewport"" content=""width=device-width, initial-scale=1.0"" />
    <meta charset=""utf-8"" />
    <title>NetnrRun</title>
</head>

<body>

</body>

</html>";
}

<partial name="_PartialMonacoEditorNav" model="mo" />

<div class="runsub @("bg-"+mo.RunTheme)" id="runsub">
    <div class="runsubc" id="runsubc" title="collapse / expand"></div>
    <div class="card @(mo.RunTheme == "vs" ? "" : "bg-dark") ml-sm-2 mr-sm-2 mt-3">
        <div class="card-header">Description</div>
        <div class="card-body">
            <textarea class="form-control" id="txtRemark" placeholder="Add some instructions to make it easier to show">@mo.RunRemark</textarea>
        </div>
    </div>
    <div class="card @(mo.RunTheme == "vs" ? "" : "bg-dark") ml-sm-2 mr-sm-2 mt-3 d-none">
        <div class="card-header">CDN Search</div>
        <div class="card-body">
            <input class="form-control" type="text" aria-label="Search" placeholder="Search " />
        </div>
    </div>
    <div class="btn-group btn-group-toggle btn-group-sm mt-3 ml-sm-2" data-toggle="buttons" title="Switching theme" id="bgtheme">
        <label class="btn btn-secondary @(mo.RunTheme == "vs" ? "active" : "")">
            <input type="radio" name="setheme" value="vs" @(mo.RunTheme == "vs" ? "checked" : "")> vs
        </label>
        <label class="btn btn-secondary @(mo.RunTheme == "vs-dark" ? "active" : "")">
            <input type="radio" name="setheme" value="vs-dark" @(mo.RunTheme == "vs-dark" ? "checked" : "")> vs-dark
        </label>
        <label class="btn btn-secondary @(mo.RunTheme == "hc-black" ? "active" : "")">
            <input type="radio" name="setheme" value="hc-black" @(mo.RunTheme == "hc-black" ? "checked" : "")> hc-black
        </label>
    </div>
    <div class="mt-3 ml-sm-2">
        <a class="btn btn-danger btn-sm" target="_blank" href="https://cdn.baomitu.com/">75CDN</a>
        <a class="btn btn-warning btn-sm" target="_blank" href="https://www.jsdelivr.com/">jsDelivr</a>
    </div>
</div>
<div class="rune" id="rune">
    <pre class="re1" data-lang="html">@(string.IsNullOrWhiteSpace(mo.RunContent1) ? "" : mo.RunContent1)</pre>
    <pre class="re2" data-lang="javascript">@(string.IsNullOrWhiteSpace(mo.RunContent2) ? "" : mo.RunContent2)</pre>
    <pre class="re3" data-lang="css">@(string.IsNullOrWhiteSpace(mo.RunContent3) ? "" : mo.RunContent3)</pre>
    <pre class="re4" data-lang="preview"><iframe src="about:blank" id="runep"></iframe></pre>
</div>
<input type="hidden" id="hidCode" value="@mo.RunCode" />

<partial name="_PartialQuote" model="@("monaco-editor")" />

<script src="/areas/run/js/rune.js" asp-append-version="true"></script>